package com.yeban.factory.new_instance;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/11/23
 */
public class FruitFactory {

    public static Fruit createFruit(String type) {
        switch (type.toLowerCase()) {
            case "apple": return new Apple();
            case "banana": return new Banana();
            default:
                throw new IllegalArgumentException("Unknown fruit type: " + type);
        }
    }
}
